import logging
import unittest

from htmltestreport import HTMLTestReport

from common.logging_use import init_log_config
from config import BASE_DIR
from scripts.test_ihrm_login_params import TestIhrmLoginPa

#初始化日志的配置信息
#文件名
init_log_config(BASE_DIR + "/log/ihrm.log")

#1.创建测试套件实例suite
suite = unittest.TestSuite()
#print("测试套件实例，创建成功")
logging.info("测试套件实例，创建成功")


#2.添加测试类，组装测试用例
suite.addTest(unittest.makeSuite((TestIhrmLoginPa)))

#3.创建HTMLTestReport 类实例runner
runner = HTMLTestReport("./report/ihrm.html",title='我是标题思密达',description='000')


#4.runner调用run(),传入suite
runner.run(suite)
logging.info("ihrm.log测试报告生成成功")
print("修改了我")

